
# 可以指定session保存位置
import logging
from flask_script import Manager
from flask_migrate import Migrate,MigrateCommand

# from config import Config
from info import creat_app,db

# 通过指定的配置名字创建对应的配置app
#create——app 就类似工厂方法
app = creat_app('development')

manager = Manager(app)
# 绑定app与db
Migrate(app,db)
# 将迁移命令添加到manager张
manager.add_command('db',MigrateCommand)


@app.route('/')
def index():
    logging.debug("This is a debug log.")
    logging.info("This is a info log.")
    logging.warning("This is a warning log.")
    logging.error("This is a error log.")
    logging.critical("This is a critical log.")
    return 'index'

if __name__ == '__main__':
    manager.run()